﻿using System;
using System.Collections.Generic;
using System.Text;

using Oracle.ManagedDataAccess.Client;

namespace WFL.Data.Oracle
{
    public class OracleContext : Context
    {
        protected override string DefaultConnectionString
        {
            get { throw new NotSupportedException("默认连接未指定"); }
        }

        public OracleContext(string name)
            : base(name)
        { 
        
        }

        public OracleContext()
            : this("Oracle")
        {
            
        }

        protected override IConnectionProxy Create(string connectionString)
        {
            OracleConnection connection = new OracleConnection(connectionString);
            connection.Open();
            return new OracleConnectionProxy(connection, connectionString);
        }
    }
}
